package com.yyk.yykywd.mvvm.adapter

import android.content.Context
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yyk.yykywd.AGENT
import com.yyk.yykywd.R
import com.yyk.yykywd.getCommonTime
import com.yyk.yykywd.mvvm.entity.HomeBean
import com.yyk.yykywd.mvvm.entity.MeetingBean
import com.yyk.yykywd.mvvm.entity.ReturnMoney
import com.yyk.yykywd.util.GlideUtils

/**
 * 文件描述：
 * Created by guo on 2019-11-19.
 */
class MeetingAdapter(private val context: Context,
                     layoutResId: Int,
                     data: List<MeetingBean.Data>) : BaseQuickAdapter<MeetingBean.Data, BaseViewHolder>(layoutResId, data) {
    override fun convert(helper: BaseViewHolder, item: MeetingBean.Data) {
        helper.setText(R.id.tv_meeting_name, item.meeting_name)
        helper.setText(R.id.tv_meeting_site, item.address)
        helper.setText(R.id.tv_start_time, getCommonTime(item.start_time))
        helper.setText(R.id.tv_founder, "创建人：" + item.name)
        helper.setText(R.id.tv_create_time, "创建时间：" + getCommonTime(item.create_time))
        val tvMeetingStatus: TextView = helper.getView(R.id.tv_meeting_status)
        when (item.status) {
            1 -> {
                tvMeetingStatus.text = "会议未开始"
                tvMeetingStatus.setTextColor(ContextCompat.getColor(context,R.color.col_5987ff))
            }
            2 -> {
                tvMeetingStatus.text = "会议已开始"
                tvMeetingStatus.setTextColor(ContextCompat.getColor(context,R.color.col_f5c161))
            }
            3 -> {
                tvMeetingStatus.text = "会议已结束"
                tvMeetingStatus.setTextColor(ContextCompat.getColor(context,R.color.gray_aa))
            }
        }
    }

}